package com.moon.bigevent.mapper;

import com.moon.bigevent.pojo.User;
import org.apache.ibatis.annotations.*;

@Mapper
public interface UserMapper {
    @Select("select *from user where username=#{username}")
    User FindByUsername(String username);
    @Insert("insert into user(username,password,create_time,update_time)" +
            "values(#{username},#{password},now(),now())")
    void add(String username, String password);

    @Delete("delete from user where username=#{username}")
    int DeleteByUsername(String username);

    @Update("update user set nickname=#{nickname},update_time=now() where id =#{id}")
    void update(User user);
}
